<div class="page_function">
  <div class="info">
    <h3>{$model_info.name}{$action_name}</h3>
    <small>使用以下功能进行{$model_info.name}{$action_name}操作</small> </div>
</div>
<div class="tab" id="tab"> 
<a class="selected" href="#tab1">基本内容</a> 
<a href="#tab2">高级信息</a> 
<a href="#tab3">扩展信息</a> 
<a href="javascript:history.go(-1)">返回上级</a></div>
<div class="page_form">
  <form action="__URL__/{$action}_save/time-<?php echo time(); ?>-ajax-true" method="post" id="form" autocomplete="off">
    <div class="page_table form_table" id="tab1">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100" align="right">栏目</td>
          <td width="350"><select name="cid"  reg="." id="cid" msg="栏目未选择" onChange="get_fields()" >
              <option value="">======选择栏目======</option>
              <!--foreach:{$category_list $vo}--> 
              <option value="{$vo['cid']}" <?php if($class_info['cid']==$vo['cid']) { ?> selected="selected" <?php } ?> 
                  <?php if($vo['type']==0 || $vo['mid']<>$model_info['mid'] || !model('user_group')->class_power($vo['cid']) ){ ?>style="background-color:#ccc"  disabled="disabled" <?php } ?>
              >
                  {$vo['cname']}
              </option>
              <!--{/foreach}-->
            </select>
            </td>
          <td></td>
        </tr>
        <tr>
          <td width="100" align="right">标题</td>
          <td colspan="2"><input name="title" type="text" class="text_value" id="title" style="float:left; width:360px;" value="{$info.title}" reg="\S" msg="标题不能为空" />
            <div class="corol_button"></div>
            <div onclick="fontbold()" class="bold_button"></div>
            <input id="font_color" name="font_color" type="hidden" value="{$info.font_color}" />
            <input id="font_bold" name="font_bold" type="hidden" value="{$info.font_bold}" /></td>
        </tr>
        <tr>
          <td width="100" align="right">推荐位</td>
          <td width="350">
          	<!--foreach:{$position_list $vo}--> 
            <input name="position[]" type="checkbox" value="{$vo.id}" <?php if(is_array($position_array)){ if(in_array($vo['id'],$position_array)){ ?> checked="checked" <?php }} ?> /> {$vo.name}&nbsp;&nbsp;
          	<!--{/foreach}-->
            </td>
          <td></td>
        </tr>
         <tr>
        <td width="100" align="right">内容形象图</td>
        <td colspan="2">
          <?php echo module('editor')->get_image_upload('image1','image',false,'editor_content') ?>
          <input name="image" type="text" class="text_value" id="image" style="width:220px; float:left" value="{$info.image}"/> 
          &nbsp;&nbsp;<input type="button" id="image1" class="button_small" value="选择图片" />
          <input type="button" class="button_small" onclick="get_one_pic()" value="提取第一张图" />
        </td>
        </tr>
        <tr>
        
      <tr>
        <td width="100" align="right">内容</td>
        <td colspan="2">
          <?php echo module('editor')->get_editor('content'); ?>
          <textarea name="content" style="width:100%; height:350px;" id="content">{$info_data.content html}</textarea>
          <input type="button" onclick="javascript:get_remote_image()" style="margin-top:10px;" class="button_small" value="远程图片本地化" />
          <?php echo module('editor')->get_editor_upload('editor_upload','editor_content') ?>
          <input type="button" id="editor_upload" class="button_small" style="margin-top:10px;" value="上传图片和文件到编辑器" />
          <!--hook-->
        	<?php module('common')->plus_hook('content','tools',$info);  ?>
      	  <!--hook end-->
          </td>
      </tr>
      <tr>
          <td width="100" align="right">内容来源</td>
          <td width="350"><input name="copyfrom" type="text" class="text_value" id="copyfrom" value="{$info.copyfrom}" /></td>
          <td></td>
      </tr>
      <tr>
        <td width="100" align="right">描述</td>
        <td colspan="2"><textarea name="description" class="text_textarea" id="description">{$info.description}</textarea>
          &nbsp;&nbsp;<input type="button" id="" onclick="javascript:get_description()" class="button_small" value="提取描述" />
        </td>
        </tr>
      <tr>
          <td width="100" align="right">关键词</td>
          <td colspan="2"><input name="keywords" type="text" class="text_value" id="keywords" value="{$info.keywords}" />
            &nbsp;&nbsp;<input type="button" id="" onclick="javascript:get_keywords()" class="button_small" value="提取关键词" />
            <?php if($info['taglink']){ ?>
            &nbsp;&nbsp;<input name="taglink" type="checkbox" value="1" checked="checked" />
            <?php }else{ ?>
            &nbsp;&nbsp;<input name="taglink" type="checkbox" value="1" />
            <?php } ?>
             内容自动链接
          </td>
        </tr>
      <!--hook-->
       <?php module('common')->plus_hook('content','edit_tpl_tag',$info);  ?>
      <!--hook end-->
      <!--hook-->
       <?php module('common')->plus_hook('content','edit_tpl',$info);  ?>
      <!--hook end-->
      <?php if(model('user_group')->model_power('content','past')){ ?>
      <tr>
        <td width="100" align="right">状态</td>
        <td width="350">
        <?php if(!isset($info['status'])){ $info['status']=1; } ?>
        <input name="status" type="radio" value="1"  <!--if:{$info['status']==1}-->checked="checked"<!--{/if}-->  /> 发布&nbsp;&nbsp;<input name="status" type="radio"  <!--if:{$info['status']==0}-->checked="checked"<!--{/if}-->  /> 草稿&nbsp;&nbsp;
        </td>
        <td></td>
      </tr>
      <?php } ?>
      <?php if(!model('user_group')->model_power('content','past')&&model('user_group')->model_power('content','cancel')){ ?>
      <input name="status" id="status" type="hidden" value="0" />
      <?php } ?>
      </table>
    </div>
    
    <div class="page_table form_table" id="tab2">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100" align="right">副标题</td>
          <td width="350"><input name="subtitle" type="text" class="text_value" id="subtitle" value="{$info.subtitle}" /></td>
          <td></td>
        </tr>
        <tr>
          <td width="100" align="right">英文URL名称</td>
          <td width="350"><input name="urltitle" type="text" class="text_value" id="urltitle" value="{$info.urltitle}" /></td>
          <td></td>
        </tr>
      <tr>
        <td width="100" align="right">访问量</td>
        <td width="350">
        <input name="views" type="text" class="text_value" id="views" value="{$info.views}" />
        </td>
        <td>内容浏览量</td>
      </tr>
      <tr>
        <td width="100" align="right">顺序</td>
        <td width="350">
        <input name="sequence" type="text" class="text_value" id="sequence" value="{$info.sequence}" />
        </td>
        <td>(自定义顺序)</td>
      </tr>
      <tr>
        <td width="100" align="right">跳转到</td>
        <td width="350">
        <input name="url" type="text" class="text_value" id="url" value="{$info.url}" />
        </td>
        <td>URL链接，支持标签</td>
      </tr>
      <tr>
        <td width="100" align="right">更新时间</td>
        <td width="350">
        <input name="updatetime"  id="updatetime" type="text" class="text_value" style="width:260px; float:left" value="<?php echo date('Y-m-d H:i:s'); ?>" reg="\S" msg="更新时间不能为空" /><div id="updatetime_button" class="time"></div>
        <script>$('#updatetime_button').calendar({ id:'#updatetime',format:'yyyy-MM-dd HH:mm:ss'});</script>
        </td>
        <td></td>
      </tr>
      <tr>
        <td width="100" align="right">内容模板</td>
        <td width="350">
        <input name="tpl" type="text" class="text_value" id="tpl" value="{$info.tpl}" />
        </td>
        <td>留空采用栏目指定模板</td>
      </tr>
      </table>
    </div>
    <div class="page_table form_table" id="tab3">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
      	  <tr>
            <td width="100" align="right" style="padding:0px; height:0px;"></td>
            <td width="350" style="padding:0px; height:0px;"></td>
            <td style="padding:0px; height:0px;"></td>
          </tr>
          <tbody id="expand">
          </tbody>
      </table>
    </div>
    <?php if(model('user_group')->model_power('content','add')||model('user_group')->model_power('content','edit')){ ?>
    <!--普通提交-->
    <div class="form_submit">
      <input name="aid" type="hidden" value="{$info.aid}" />
      <input name="file_id" id="file_id" type="hidden" value="{$file_id}" />
      <button type="submit" class="button">保存</button>
    </div>
    <?php } ?>
  </form>
</div>
</div>
{include file="content/common"}